#define _CRT SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
    int splitArray(vector<int>& nums, int k) {
        long long left = 0, right = 0, mid = 0;
        for (auto i : nums)
        {
            left = left > i ? left : i;
            right += i;
        }
        while (left < right)
        {
            mid = left + (right - left) / 2;
            int cnt = 1;
            int sum = 0;
            for (auto i : nums)
            {
                sum += i;
                if (sum > mid)
                {
                    cnt++;
                    sum = i;
                }
            }
            if (cnt > k)
            {
                left = mid + 1;
            }
            else
            {
                right = mid;
            }
        }
        return left;
    }
};
int main()
{
    A s;
    int ret = sizeof(s);
    cout << ret;
    return 0;
}

